<?php
/**
 * Get.php
 * Created by PhpStorm.
 * User: 江小波
 * Date: 2019/06/14
 * Time: 13:20
 */
namespace app\api\open\member\order;

use app\api\open\member\Token;
use app\api\model\OrderModel;
use app\common\Singleton;

class Get extends Token
{
    use Singleton;

    public function __construct($param = [])
    {
        try{
            parent::__construct($param);
        }catch (\Exception $e) {
            $this->member_id = null;
            $this->token_data = [];
        }
    }
    
    /**
     * @param array $param
     * @return array|false|null|\PDOStatement|string|\think\Model
     * @throws \Exception
     */
    public function index($param=[])
    {
        // 获取详情
        $info = OrderModel::getInstance()->get(['id'=>$param['id']]);
        if(empty($info['id']))
        {
            throw new \Exception("查询结果为空",1);
        }
        return $info;
    }
}